<?php

class CommentModel extends Model
{


    public function countComment($newshash)
    {
        $ret  = $this->field("COUNT(commentid) AS t")->where("newshash=$newshash")->find();
        return $ret["t"];
    }


    public function getComment($newshash, $page, $limit)
    {
        return $this->where("newshash=$newshash")->limit( ($page-1)*$limit.",".$limit)->findAll();
    }

}

?>